
package org.movee.spring.data.hugegraph.query.paramerter;

import org.movee.spring.data.hugegraph.repository.query.HugeQueryMethod;
import org.springframework.data.repository.query.ParametersParameterAccessor;

public class HugeParametersParameterAccessor extends ParametersParameterAccessor
        implements HugeParameterAccessor {


    private final Object[] paraValues;
    private Boolean valueSetted;

    public HugeParametersParameterAccessor(HugeQueryMethod method, Object[] values) {
        super(method.getParameters(), values);

        this.paraValues = new Object[values.length];
        this.valueSetted = false;

    }

    public Object[] getValues() {

        if (!valueSetted) {
            for (int i = 0; i < paraValues.length; i++) {
                paraValues[i] = super.getValue(i);
            }

            valueSetted = true;
        }

        return paraValues;
    }
}
